/**
 * @returns 路由跳转参数装换
 */
export const routerTransitionParams = (params = {}, url = "", row = {}) => {
  const arr = [];
  Object.keys(params).forEach(key => {
    console.log(params[key], "params[key]");
    console.log(typeof params[key] === "string", "srt");

    if (params[key] && typeof params[key] === "string" && params[key].includes("$")) {
      const k = params[key].replace("$", "");
      arr.push(`${key}=${row[k] ?? ""}`);
    } else {
      arr.push(`${key}=${params[key] ?? row[key] ?? ""}`);
    }
  });
  return url + "?" + arr.join("&");
};
